
package com.rainsoftware.LicenseSystem.utils;

public class PasswordChecker {

    // Validate username length
    public static boolean isUsernameValid(String username) {
        return username.length() >= 4 && username.length() <= 254;
    }

    // Validate password strength
    public static boolean isPasswordValid(String password) {
        return password.length() >= 6 && password.matches(".*[a-zA-Z].*") && password.matches(".*[0-9].*");
    }

    // Validate both username and password
    public static boolean isUsernameAndPasswordValid(String username, String password) {
        return isUsernameValid(username) && isPasswordValid(password);
    }
}